/**
 * \file CodeProfile.h
 * \brief CodeProfile declaration class for Linux platforms
 * \author Edouard ROGE
 * \date 16 October 2012
 */
#ifndef _CODEPROFILE_LINUX_
#define _CODEPROFILE_LINUX_

#include "Core/Define/Define.h"

/**
 * \class CodeProfile
 * \brief Measure in milliseconds a piece of code where this object exists.
 */
class CodeProfile
{
public:

	/**
	 * \fn CodeProfile(const char * _name, uint32 _parentThreadId = 0);
	 * \param _name name of the function to profile
	 * \param _parentThreadId id of the parent thread
	 * \brief Constructor and start profiling
	 */
	CodeProfile(const char * _name, uint32 _parentThreadId = 0);

	/**
	 * \fn ~CodeProfile();
	 * \brief Destructor and stop profiling
	 */
	~CodeProfile();

private:

	/** index of the time in the vector */
	uint32 m_iIndexTimeMeasure;

};

/** Macro for profiling */
#define PROFILE(name) CodeProfile codeProfile(name);

#define PROFILEEX(name, parent) CodeProfile codeProfile(name, parent);


#endif // _CODEPROFILE_LINUX_
